﻿using System;
using Evaluant.NLinq.Expressions;

namespace Evaluant.NLinq
{
    public partial class Parser
    {
        MemberExpression FindDeepest(MemberExpression exp)
        {
            if (exp == null)
                return null;
            if (exp.Previous == null)
                return exp;
            return FindDeepest(exp.Previous as MemberExpression) ?? exp;
        }
    }
}
